//
//  ViewController.swift
//  ReachablilityDemo-Swift
//
//  Created by 李煜 on 2024/6/3.
//

import UIKit
import CoreTelephony
import Reachability
class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

    }


}

extension ViewController{
    
    
    func checkCellularDataPermission() -> Bool {
        let cellularData = CTCellularData()
        let permissionStatus = cellularData.restrictedState
        return permissionStatus != .restricted
    }
    
    
    func checkWiFiPermission() -> Bool {
        let reachability = try? Reachability()
        return reachability?.connection != .unavailable
    }
}
